package com.ly.mpayment.persist.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

@Entity
@Table(name = "product_price_up")
public class ProductPriceUp {

    private String id;
    private String upName;
    private BigDecimal beforeDiscount;
    private BigDecimal afterDiscount;
    private ProductTimerUp proId;
    private UpShopProduct productId;
    private User userId;
    private String productName;
    private BigDecimal beforeValue;
    private BigDecimal afterValue;


    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "id", unique = true,nullable=false)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(name = "up_name")
    public String getUpName() {
        return upName;
    }


    public void setUpName(String upName) {
        this.upName = upName;
    }

    @Column(name = "before_discount")
    public BigDecimal getBeforeDiscount() {
        return beforeDiscount;
    }

    public void setBeforeDiscount(BigDecimal beforeDiscount) {
        this.beforeDiscount = beforeDiscount;
    }

    @Column(name = "after_discount")
    public BigDecimal getAfterDiscount() {
        return afterDiscount;
    }

    public void setAfterDiscount(BigDecimal afterDiscount) {
        this.afterDiscount = afterDiscount;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="pro_id")
    public ProductTimerUp getProId() {
        return proId;
    }

    public void setProId(ProductTimerUp proId) {
        this.proId = proId;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="product_id")
    public UpShopProduct getProductId() {
        return productId;
    }

    public void setProductId(UpShopProduct productId) {
        this.productId = productId;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="user_id")
    public User getUserId() {
        return userId;
    }

    public void setUserId(User userId) {
        this.userId = userId;
    }

    @Column(name = "product_name")
    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    @Column(name = "before_value")
    public BigDecimal getBeforeValue() {
        return beforeValue;
    }

    public void setBeforeValue(BigDecimal beforeValue) {
        this.beforeValue = beforeValue;
    }

    @Column(name = "after_value")
    public BigDecimal getAfterValue() {
        return afterValue;
    }

    public void setAfterValue(BigDecimal afterValue) {
        this.afterValue = afterValue;
    }
}
